package com.hzw.saas.service.project.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzw.saas.common.config.util.PageParam;
import com.hzw.saas.service.project.bo.ProjectApplyBO;
import com.hzw.saas.service.project.bo.ProjectApplyInfoBO;
import com.hzw.saas.service.project.bo.ProjectApplyScrollBo;
import com.hzw.saas.service.project.model.ProjectApply;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author sonam
 * @since 2021-08-04
 */
public interface IProjectApplyService extends IService<ProjectApply> {

    String getProjectApplyId(String flowInstanceId);

    /**
     * 获取项目申请
     * 两个参数选必须选择一个填写
     *
     * @param flowInstanceId 流程实例ID
     * @param projectApplyId 项目申请ID
     * @return
     */
    ProjectApplyBO getProjectApply(String flowInstanceId, String projectApplyId);

    /**
     * 分页获取项目申请管理列表
     *
     * @param pageParam
     * @param flowId
     * @param fuzzy
     * @param type
     * @param statusIds
     * @param notifyState
     * @param sort
     * @return
     */
    IPage<ProjectApplyInfoBO> pageProjectApply(PageParam pageParam, String flowId, String fuzzy, Integer type, List<String> statusIds, Integer notifyState, List<String> levelIds, Integer sort);

    /**
     * 创建项目申请
     *
     * @param query
     * @param isSubmit
     */
    ProjectApply createProjectApply(ProjectApply query, boolean isSubmit);

    void updateProjectApply(ProjectApply query, boolean isSubmit);

    /**
     * 项目审批通过，导出项目申请PDF
     *
     * @param flowInstanceId
     * @param response
     * @param isAdmin
     */
    void projectApplyExportPDF(String flowInstanceId, HttpServletResponse response, boolean isAdmin);

    void updateProjectAcceptance(String projectApplyId, String userId, String acceptanceInstruction, boolean isSubmit);

        /**
     * 获取一定数量的 项目审批通过公告
     *
     * @param count the count
     * @return the list
     */
    List<ProjectApplyScrollBo> limitProjectScroll(Integer count);
}
